package skiplist2

import (
	"fmt"
)

// nolint:unused
func Output(sl *SkipList2) {
	var x *Element
	for i := 0; i < SKIPLIST_MAXLEVEL; i++ {
		count := 0
		x = sl.header.level[i].forward
		for x != nil {
			if count == 0 {
				fmt.Printf("LEVEL[%v]: ", i)
				fmt.Printf("nil(0)(%v) -> ", sl.header.level[i].span)
			}
			fmt.Printf("%v(%v)(%v) -> ", x.Value(), x.SubSL.Len(), x.level[i].span)
			count++
			x = x.level[i].forward
		}
		// fmt.Println("NIL")
		if count > 0 {
			fmt.Printf("count=%v, len==%v\n", count, sl.Len())
		}
	}
}
